<template>
  <div class="app-container">
    <div class="filter-container">
      <el-input
        style="width: 200px;"
        class="filter-item"
        placeholder="用户姓名"
        v-model="queryForm.realName"
      ></el-input>
      <el-input
        style="width: 200px;"
        class="filter-item"
        placeholder="竞标编号"
        v-model="queryForm.markCode"
      ></el-input>
      <el-input
        style="width: 200px;"
        class="filter-item"
        placeholder="竞标参加编号"
        v-model="queryForm.recordCode"
      ></el-input>
      <el-input
        style="width: 200px;"
        class="filter-item"
        placeholder="出价单号"
        v-model="queryForm.voucherCode"
      ></el-input>
      <el-select
        clearable
        style="width: 170px"
        class="filter-item"
        v-model="queryForm.payType"
        placeholder="请选择支付方式"
      >
        <el-option
          v-for="(val, key) in Dicts.PAY_TYPE"
          :key="key"
          :label="val"
          :value="key"
        ></el-option>
      </el-select>
      <el-select
        clearable
        style="width: 170px"
        class="filter-item"
        v-model="queryForm.status"
        placeholder="请选择出价状态"
      >
        <el-option
          v-for="(val, key) in Dicts.MARK_PAY_RECORD_STATUS"
          :key="key"
          :label="val"
          :value="key"
        ></el-option>
      </el-select>
      <el-button
        class="filter-item"
        @click="doQuery"
        type="primary"
        icon="el-icon-search"
        >查询</el-button
      >
    </div>
    <el-table v-loading="loading" :data="records" style="width: 100%">
      <el-table-column prop="rowId" label="ID" width="100" align="center">
      </el-table-column>
      <el-table-column
        prop="realName"
        label="用户姓名"
        width="150"
        align="center"
      >
      </el-table-column>
      <el-table-column
        prop="markCode"
        label="竞标编号"
        width="250"
        align="center"
      >
      </el-table-column>
      <el-table-column
        prop="recordCode"
        label="竞标参加编号"
        width="250"
        align="center"
      >
      </el-table-column>
      <el-table-column
        prop="voucherCode"
        label="出价单号"
        width="250"
        align="center"
      >
      </el-table-column>
      <el-table-column
        prop="payType"
        label="支付方式"
        width="150"
        align="center"
      >
        <template slot-scope="scope">
          {{ Dicts.PAY_TYPE[scope.row.payType] }}
        </template>
      </el-table-column>
      <el-table-column
        prop="payTime"
        label="出价时间"
        width="250"
        align="center"
      >
      </el-table-column>
      <el-table-column
        prop="payAmount"
        label="出价金额"
        width="200"
        align="center"
      >
        <template slot-scope="scope">
          {{ `￥${scope.row.payAmount}` }}
        </template>
      </el-table-column>
      <el-table-column
        prop="transAmt"
        label="实付金额"
        width="200"
        align="center"
      >
        <template slot-scope="scope">
          {{ `￥${scope.row.transAmt}` }}
        </template>
      </el-table-column>
      <el-table-column
        prop="status"
        label="出价状态"
        width="150"
        align="center"
      >
        <template slot-scope="scope">
          {{ Dicts.MARK_PAY_RECORD_STATUS[scope.row.status] }}
        </template>
      </el-table-column>
      <el-table-column align="center" label="" class-name="small-padding">
        <!-- <template slot-scope="scope">
            <el-button size="mini" @click="detailAdBidMarkJoinRecord(scope.row)" title="详情" icon="el-icon-search" circle></el-button>
        </template> -->
      </el-table-column>
    </el-table>
    <div class="pagination-container">
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="queryForm.current"
        :page-sizes="[10, 20, 30, 50]"
        :page-size="queryForm.size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="queryForm.total"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
import { queryAdBidMarkPayRecord } from '@/api/ad'

export default {
  name: 'adBidMarkPayRecord',
  data() {
    return {
      checkDialogFormVisible: false,
      detailsDialogFormVisible: false,
      loading: false,
      queryForm: {
        current: 1,
        pages: 0,
        total: 0,
        size: 10,
        title: undefined
      },
      records: []
    }
  },
  created() {
    this.doQuery()
  },
  methods: {
    handleCurrentChange(current) {
      this.queryForm.current = current
      this.doQuery()
    },
    handleSizeChange(size) {
      this.queryForm.size = size
      this.doQuery()
    },
    doQuery() {
      this.loading = true
      queryAdBidMarkPayRecord(this.queryForm).then(({ data: { data } }) => {
        this.queryForm.current = data.current
        this.queryForm.pages = data.pages
        this.queryForm.total = data.total
        this.queryForm.size = data.size
        this.records = data.records
        this.loading = false
      })
    }
  },
  components: {}
}
</script>

<style scoped></style>
